﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TBlog.Models.ViewData.PostModel>" %>
<%@ Import Namespace="TBlog.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

        <% var p = Model.Posts.FirstOrDefault(); %>
        <% if(p != null){ %>
        <%-- <!-- main --> --%>
		<div id="main" class="grid_8">
			<h2><a href="" rel="bookmark" title="Permanent Link to "><%= Html.Encode(p.post_title)%></a></h2>
			<p class="post-info">Posted by <%=Html.Encode(p.post_author)%> | Filed under xxxxx</p>
			    <%=Html.Encode(p.post_content)%>
                Read the rest of this entry...
            <p>Tags: aaa,bbb,ccc</p>
			<p class="postmeta">
			<a href="" class="readmore">Read more</a> |
			<a href="" class="comments">Comments (0)</a> |	
			<span class="date"><%=Html.Encode(p.post_date.ToShortDateString())%> <%=Html.Encode(p.post_date.ToShortTimeString())%></span>	
			</p>
            <%-- <?php endwhile; ?> --%>

            <div class="alignleft">
            <%
                if (Model.Posts.HasPreviousPage){
                    Response.Write(Html.ActionLink(ConfigurationManager.AppSettings["newer_entries"], "Post/" + p.post_id + "/" + (Model.Posts.PageIndex - 1)));
                } 
            %>
            </div>

            <div class="alignright">
            <%
                if (Model.Posts.HasNexePage){
                    Response.Write(Html.ActionLink(ConfigurationManager.AppSettings["older_entries"], "Post/" + p.post_id + "/" + (Model.Posts.PageIndex + 1)));
                } 
            %>
            </div>

		</div>
        <%-- <!-- main ends --> --%>
        <% }else{ %>
            <div id="Div1" class="grid_8">
                <h2>Not Found</h2>
                <p>aaaaaaa</p>
            </div>
        <% } %>
<!--
    <p>
        <%: Html.ActionLink("Edit", "Edit", new { /* id=Model.PrimaryKey */ }) %> |
        <%: Html.ActionLink("Back to List", "Index") %>
    </p>
-->

</asp:Content>

